package net.pessu.android.shoppoid;

import greendroid.app.GDActivity;
import net.pessu.android.shoppoid.calendar.DateDesSoldes;
import net.pessu.android.shoppoid.convertisseur.ConvertisseurList;
import net.pessu.android.shoppoid.debrief.Debrief;
import net.pessu.android.shoppoid.init.Initialiseur;
import net.pessu.android.shoppoid.remise.Remise;
import net.pessu.android.shoppoid.wishlist.WishList;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

public class Welcome extends GDActivity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setActionBarContentView(R.layout.welcome);

		OnClickListener eventRemise = new OnClickListener() {
			public void onClick(View v) {
				launchAdder();
			}
		};

		((View) findViewById(R.id.tableRowRemise))
				.setOnClickListener(eventRemise);
		
		

		OnClickListener eventWishList = new OnClickListener() {
			public void onClick(View v) {
				wishListAdder();
			}
		};

		((View) findViewById(R.id.tableRowWishList))
				.setOnClickListener(eventWishList);

		OnClickListener eventconvList = new OnClickListener() {
			public void onClick(View v) {
				convertisseurListAdder();
			}
		};

		((View) findViewById(R.id.tableRowConv))
				.setOnClickListener(eventconvList);

		OnClickListener eventDebrief = new OnClickListener() {
			public void onClick(View v) {
				debriefAdder();
			}
		};

		((View) findViewById(R.id.tableRowDebrief))
				.setOnClickListener(eventDebrief);

		OnClickListener eventMCal = new OnClickListener() {
			public void onClick(View v) {
				calLocatorAdder();
			}
		};

		((View) findViewById(R.id.tableRowCal)).setOnClickListener(eventMCal);

		Initialiseur.initialiser(this);
	}

	/**
	 * Launches the remise activity to add a new contact to the selected accont.
	 */
	protected void launchAdder() {
		startActivity(new Intent(this, Remise.class));
	}

	/**
	 * Launches the wishlist activity to add a new contact to the selected
	 * accont.
	 */
	protected void wishListAdder() {
		startActivity(new Intent(this, WishList.class));
	}

	/**
	 * Launches the ConvertisseurList activity to add a new contact to the
	 * selected accont.
	 */
	protected void convertisseurListAdder() {
		startActivity(new Intent(this, ConvertisseurList.class));
	}

	/**
	 * Launches the debriefAdder activity to add a new contact to the selected
	 * accont.
	 */
	protected void debriefAdder() {
		startActivity(new Intent(this, Debrief.class));
	}

	protected void calLocatorAdder() {
		startActivity(new Intent(this, DateDesSoldes.class));
	}
}
